let express = require('express');
let router = express.Router();
let handler = require('./handler')
//渲染数据库已有的数据
router.get('/getalldata', (req, res) => {
  //这个是路由引路作用不处理数据
  handler.getalldata(req, res)
})
//上传图片
router.post('/uploadFile', (req, res) => {
  handler.uploadFile(req, res)
})

//新增
router.post('/add', (req, res) => {
  handler.add(req, res)
})

//点击修改传入id
router.get('/getHeroById', (req, res) => {
  handler.getHeroById(req, res)
})

//点击编辑
router.post('/edit', (req, res) => {
  handler.edit(req, res)
})

//暴露
module.exports = router